<?php
/**
 * 此题无解 中转输入脚本 demo版
 *
 * @category   
 * @author  	此题无解
 * 更多Web安全交流 Q群：260044099
 */
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">
<head>
	<meta http-equiv="Content-Type" content="text/html;charset=UTF-8">
	<meta http-equiv="auth" content="此题无解">
	<meta name="viewport" content="width=device-width, initial-scale=1.0">
    <link rel="stylesheet" href="./css/bootstrap.min.css">
    <link rel="stylesheet" href="./css/custom.css">
	<title>PHP Transfrom Script by 此题无解</title>
</head>
<body>
<?php
include("Transform.class.php");
$p_url = $_SERVER["PHP_SELF"];
$t_port = $_SERVER["SERVER_PORT"] == 80?"":":".$_SERVER["SERVER_PORT"]."";
$t_url = "http://".$_SERVER["HTTP_HOST"].$t_port.$p_url."?id=";

$default_url = "";
$default_header = <<<EOT
EOT
?>
<div class="container">
	<div class="jumbotron">
		<h1><span class="letter" data-letter="中">中</span>
		<span class="letter" data-letter="转">转</span>
		<span class="letter" data-letter="配">配</span>
		<span class="letter" data-letter="置">置</span>
		</h1>
		<blockquote>中转后参数为<span class="text-success">id</span>,<br>配置完成后,最终结果为 <?=$t_url?><small class="pull-right"><cite>此题无解</cite></small></blockquote>
		<a href="#" class="btn btn-primary btn-lg" id="save" role=button>保存配置</a>
		<a href="about.php" class="btn btn-primary btn-lg" id="save" role=button>关于</a>
	</div>
</div>


<div class="container">
	<div class="col-md-6">
		<div class="panel panel-primary">
			<div class="panel-heading">源配置</div>
			<form action="" method="post" id="souform">
			<div class="panel-body">
				<ul class="nav nav-tabs">
					<li class="dropdown" id="method-type">
						<a href="#" id="method-meun" class="dropdown-toggle" data-toggle="dropdown">提交方式<b class="caret"></b></a>
						<ul class="dropdown-menu" role="menu" aria-labelledby="method-way">
							<li><a href="#get-tab" tabindex="-1" data-toggle="tab">url</a></li>
							<li><a href="#post-tab" tabindex="-1" data-toggle="tab">package</a></li>
						</ul>
					</li>
					<li><a href="#param-tab" data-toggle="tab">参数</a></li>
				</ul>

				<div class="tab-content">
					<div class="tab-pane active" id="get-tab">
						<div class="form-group">
						    <label  class="col-sm-2 control-label">Method</label>
						    <div class="col-sm-10">
						    	<select class="form-control" name="method">
								  <option>Get</option>
								  <option>Post</option>
								</select>
						    </div>
						</div>
						<div class="form-group">
						    <label for="inputurl" class="col-sm-2 control-label">Url</label>
						    <div class="col-sm-10">
						      <input type="text" class="form-control" name="url" id="inputurl" placeholder="input url here" value="<?=$default_url?>">
						    </div>
						</div>
						<div class="form-group">
						    <label for="inputparam" class="col-sm-2 control-label">PostValue</label>
						    <div class="col-sm-10">
						      <input type="text" class="form-control" name="postparam" id="inputparam" placeholder="Post方式才需要这个字段" disabled	>
						    </div>
						</div> 
					</div> <!-- end of get-tab -->
					<div class="clearfix"></div>
					<div id="post-tab" class="tab-pane">
						<div class="">
							<div class="form-group">
							    <label for="inputpackage" class="col-sm-2 control-label">Package</label>
							    <div class="col-sm-10">
							      <textarea name="header" id="inputpackage" name="package" cols="30" rows="10" placeholder="burp等各种抓包工具得到的包" ><?=$default_header?></textarea>
							    </div>
							</div> 
						</div>
					</div> <!-- end of post-tab -->

					<div id="param-tab" class="tab-pane">
						<div class="form-group">
							<label class="col-sm-3 control-label">伪静态URl</label>
							<div class="col-sm-9">
							<label class="checkbox" for="fakeurl"><input  type="checkbox" id="fakeurl" name="fakeurl" value="1">如果是伪静态，用[ctwj]代替正常值</label>
							</div>
						</div>
						<div class="form-group">
							<label for="inputinjparam" class="col-sm-3 control-label">中转参数</label>
							<div class="col-sm-9"><input type="text" class="form-control" name="injectparam" id="inputinjparam"/></div>
						</div>
						<div class="form-group">
							<label for="inputparam" class="col-sm-3 control-label">正常参数值</label>
							<div class="col-sm-9"><input type="text" class="form-control" name="injectvalue" id="inputinjvalue"/></div>
						</div>
					</div> <!-- end of param-tab -->
				</div>
			</div>
			</form>
			<div class="panel-footer"><div class="">原始访问配置</div></div>

		</div>
	</div>
	<div class="col-md-6">
		<form action="#" method="post">
		<div class="panel panel-danger">
		  	<div class="panel-heading">
				<h3 class="panel-title">端配置</h3>
		  	</div>
		  	<div class="panel-body">
	            <ul class="nav nav-tabs">
	                <li class="active"><a href="#1" data-toggle="tab">提交规则</a></li>
	                <li><a href="#tt" data-toggle="tab">参数编码规则</a></li>
	            </ul>
	            <div class="tab-content">
	                <div class="tab-pane active" id="1">
		                <div class="alert alert-info">
		                	<button type="button" class="close" data-dismiss="alert" aria-hidden="true">&times;</button>
		                	<strong>注意!</strong>&nbsp;提交规则只对设置的中转参数生效
		                </div>
		                <div class="list-group">
						  <label class="list-group-item radio"><input type="radio" name="method_way" checked value="default">&nbsp;默认 <blockquote class="pull-right"><small>使用原始的提交方式</small></blockquote></label>
						  <label class="list-group-item radio"><input type="radio" name="method_way" value="get">&nbsp;Get<blockquote class="pull-right"><small>将中转参数通过GET提交</small></blockquote></label>
						  <label class="list-group-item radio"><input type="radio" name="method_way" value="Post">&nbsp;Post<blockquote class="pull-right"><small>将中转参数通过POST提交</small></blockquote></label>
						  <label class="list-group-item radio"><input type="radio" name="method_way" value="Cookie">&nbsp;Cookie<blockquote class="pull-right"><small><cite>将中转参数通过COOKIE提交</cite></small></blockquote></label>
						  <label class="list-group-item radio"><input type="radio" name="method_way" value="multi">&nbsp;multipart/form-data<blockquote class="pull-right"><small><cite>通过上传文件的表单提交</cite></small></blockquote></label>
						  <label class="list-group-item checkbox"><input type="checkbox" name="method_ext" name="ChooperPassDog" value="chopper">&nbsp;菜刀一句话过狗<blockquote class="pull-right"><small><cite>理论上支持所有脚本</cite></small></blockquote></label>
						</div>
					</div>
	                <div id="tt" class="tab-pane">
	                	<div class="list-group">
						  <label class="list-group-item checkbox"><input type="checkbox" name="encode_way" value="passDogInject">&nbsp;bypass SafeDog <blockquote class="pull-right"><small>PHP过狗注入</small></blockquote></label>
						  <!--<label class="list-group-item radio"><input type="radio" name="encode_way" value="get">&nbsp;Get<blockquote class="pull-right"><small>将中转参数通过GET提交</small></blockquote></label>-->
						  <!--<label class="list-group-item radio"><input type="radio" name="encode_way" value="Post">&nbsp;Post<blockquote class="pull-right"><small>将中转参数通过POST提交</small></blockquote></label>-->
						  <!--<label class="list-group-item radio"><input type="radio" name="encode_way" value="Cookie">&nbsp;Cookie<blockquote class="pull-right"><small><cite>将中转参数通过COOKIE提交</cite></small></blockquote></label>-->
						  <!--<label class="list-group-item radio"><input type="radio" name="encode_way" value="multi">&nbsp;multipart/form-data<blockquote class="pull-right"><small><cite>通过上传文件的表单提交</cite></small></blockquote></label>-->
						  <!--<label class="list-group-item checkbox"><input type="checkbox" name="method_ext">&nbsp;Cookie</label>-->
						</div>
	                </div>
	            </div>
		  	</div>
		  	<div class="panel-footer">中转后提交规则</div>
		</div>
		</form>
	</div>

</div>
<div class="container">
	<div class="well"><h4><?=PROJECTNAME?><strong><?=VERSION?></strong></h4><p>code by <?=AUTHOR?> <br>
	<form class="input-prepend">
	<input type="button" class="btn" id="load" value=load><span class="add-on">Porject</span><input class="span2" id="prependedInput" name="config" type="text" placeholder="default">不同站点保存时指定项目名
	</form><br>
	更多Web安全交流 欢迎加群:<span class="label label-success">260044099</span><p>
	</div>
</div>

<script src="./js/jquery.min.js"></script>
<script src="./js/bootstrap.min.js"></script>
<script>
	$(function(){
		$("label.list-group-item > blockquote").attr("hidden", true);
		$("#save").click(function(){'index.php?id='
			var url = document.location.href.replace(/index.php/,'')+"SaveConfig.php";
			$.post(url, $("form").serialize(), function(data){
				if (data['status'] == 'ok') alert('保存成功');
				else alert(data['info']);
			}, "json");
			return false;
		});
		$("select>option:eq(0)").click(function(){
			$("#inputparam").attr("disabled",true);
		});
		$("select>option:eq(1)").click(function(){
			$("#inputparam").attr("disabled",false);
		});
		$("label.list-group-item").click(function(){
			$("label.list-group-item > blockquote").attr("hidden", true);
			$(this).children().attr("hidden", false);
		});
	});
</script>
</body>
</html>

